3.146 \(\int (a-a \sec ^2(c+d x))^2 \, dx\)

Optimal. Leaf size=38 \[ \frac {a^2 \tan ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}+a^2 x \]

[Out]

a^2*x-a^2*tan(d*x+c)/d+1/3*a^2*tan(d*x+c)^3/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4120, 3473, 8} \[ \frac {a^2 \tan ^3(c+d x)}{3 d}-\frac {a^2 \tan (c+d x)}{d}+a^2 x \]

Antiderivative was successfully verified.

[In]

Int[(a - a*Sec[c + d*x]^2)^2,x]

[Out]

a^2*x - (a^2*Tan[c + d*x])/d + (a^2*Tan[c + d*x]^3)/(3*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 4120

Int[(u_.)*((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Dist[b^p, Int[ActivateTrig[u*tan[e + f*x
]^(2*p)], x], x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0] && IntegerQ[p]

Rubi steps

\begin {align*} \int \left (a-a \sec ^2(c+d x)\right )^2 \, dx &=a^2 \int \tan ^4(c+d x) \, dx\\ &=\frac {a^2 \tan ^3(c+d x)}{3 d}-a^2 \int \tan ^2(c+d x) \, dx\\ &=-\frac {a^2 \tan (c+d x)}{d}+\frac {a^2 \tan ^3(c+d x)}{3 d}+a^2 \int 1 \, dx\\ &=a^2 x-\frac {a^2 \tan (c+d x)}{d}+\frac {a^2 \tan ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 42, normalized size = 1.11 \[ a^2 \left (\frac {\tan ^{-1}(\tan (c+d x))}{d}+\frac {\tan ^3(c+d x)}{3 d}-\frac {\tan (c+d x)}{d}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(a - a*Sec[c + d*x]^2)^2,x]

[Out]

a^2*(ArcTan[Tan[c + d*x]]/d - Tan[c + d*x]/d + Tan[c + d*x]^3/(3*d))

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 56, normalized size = 1.47 \[ \frac {3 \, a^{2} d x \cos \left (d x + c\right )^{3} - {\left (4 \, a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \sin \left (d x + c\right )}{3 \, d \cos \left (d x + c\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*sec(d*x+c)^2)^2,x, algorithm="fricas")

[Out]

1/3*(3*a^2*d*x*cos(d*x + c)^3 - (4*a^2*cos(d*x + c)^2 - a^2)*sin(d*x + c))/(d*cos(d*x + c)^3)

________________________________________________________________________________________

giac [A]  time = 0.22, size = 39, normalized size = 1.03 \[ \frac {a^{2} \tan \left (d x + c\right )^{3} + 3 \, {\left (d x + c\right )} a^{2} - 3 \, a^{2} \tan \left (d x + c\right )}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*sec(d*x+c)^2)^2,x, algorithm="giac")

[Out]

1/3*(a^2*tan(d*x + c)^3 + 3*(d*x + c)*a^2 - 3*a^2*tan(d*x + c))/d

________________________________________________________________________________________

maple [A]  time = 1.02, size = 49, normalized size = 1.29 \[ \frac {-a^{2} \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )-2 a^{2} \tan \left (d x +c \right )+a^{2} \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a-a*sec(d*x+c)^2)^2,x)

[Out]

1/d*(-a^2*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)-2*a^2*tan(d*x+c)+a^2*(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 45, normalized size = 1.18 \[ a^{2} x + \frac {{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} a^{2}}{3 \, d} - \frac {2 \, a^{2} \tan \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*sec(d*x+c)^2)^2,x, algorithm="maxima")

[Out]

a^2*x + 1/3*(tan(d*x + c)^3 + 3*tan(d*x + c))*a^2/d - 2*a^2*tan(d*x + c)/d

________________________________________________________________________________________

mupad [B]  time = 4.40, size = 33, normalized size = 0.87 \[ a^2\,x-\frac {a^2\,\left (3\,\mathrm {tan}\left (c+d\,x\right )-{\mathrm {tan}\left (c+d\,x\right )}^3\right )}{3\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a - a/cos(c + d*x)^2)^2,x)

[Out]

a^2*x - (a^2*(3*tan(c + d*x) - tan(c + d*x)^3))/(3*d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a^{2} \left (\int 1\, dx + \int \left (- 2 \sec ^{2}{\left (c + d x \right )}\right )\, dx + \int \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a-a*sec(d*x+c)**2)**2,x)

[Out]

a**2*(Integral(1, x) + Integral(-2*sec(c + d*x)**2, x) + Integral(sec(c + d*x)**4, x))

________________________________________________________________________________________